/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.hieu.sms.model;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * 
 * @author do_th
 */
@Entity
@Table(name = "course_score_factor")
@NamedQueries({
		@NamedQuery(name = "CourseScoreFactor.findAll", query = "SELECT c FROM CourseScoreFactor c"),
		@NamedQuery(name = "CourseScoreFactor.findById", query = "SELECT c FROM CourseScoreFactor c WHERE c.id = :id"),
		@NamedQuery(name = "CourseScoreFactor.findByDepId", query = "SELECT c FROM CourseScoreFactor c WHERE c.depId = :depId"),
		@NamedQuery(name = "CourseScoreFactor.findByCourseId", query = "SELECT c FROM CourseScoreFactor c WHERE c.courseId = :courseId"),
		@NamedQuery(name = "CourseScoreFactor.findByCourse", query = "SELECT c FROM CourseScoreFactor c WHERE c.depId = :depId AND c.courseId = :courseId"),
		@NamedQuery(name = "CourseScoreFactor.findByMidTestFactor", query = "SELECT c FROM CourseScoreFactor c WHERE c.midTestFactor = :midTestFactor"),
		@NamedQuery(name = "CourseScoreFactor.findByEssaysFactor", query = "SELECT c FROM CourseScoreFactor c WHERE c.essaysFactor = :essaysFactor"),
		@NamedQuery(name = "CourseScoreFactor.findByFinalTestFactor", query = "SELECT c FROM CourseScoreFactor c WHERE c.finalTestFactor = :finalTestFactor") })
public class CourseScoreFactor extends AbstractPersistentEntity {
	private static final long serialVersionUID = 1L;
	@Id
	@Column(name = "id", updatable = false)
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "CourseScoreFactorSequence")
	@SequenceGenerator(name = "CourseScoreFactorSequence", sequenceName = "seq_course_score_factor", allocationSize = 1)
	private Long id;
	@Basic(optional = false)
	@Column(name = "dep_id")
	private String depId;
	@Basic(optional = false)
	@Column(name = "course_id")
	private String courseId;
	// @Max(value=?) @Min(value=?)//if you know range of your decimal fields
	// consider using these annotations to enforce field validation
	@Column(name = "mid_test_factor")
	private Float midTestFactor;
	@Column(name = "essays_factor")
	private Float essaysFactor;
	@Column(name = "final_test_factor")
	private Float finalTestFactor;

	public CourseScoreFactor() {
	}

	public CourseScoreFactor(Long id) {
		this.id = id;
	}

	public CourseScoreFactor(Long id, String depId, String courseId) {
		this.id = id;
		this.depId = depId;
		this.courseId = courseId;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getDepId() {
		return depId;
	}

	public void setDepId(String depId) {
		this.depId = depId;
	}

	public String getCourseId() {
		return courseId;
	}

	public void setCourseId(String courseId) {
		this.courseId = courseId;
	}

	public Float getMidTestFactor() {
		return midTestFactor;
	}

	public void setMidTestFactor(Float midTestFactor) {
		this.midTestFactor = midTestFactor;
	}

	public Float getEssaysFactor() {
		return essaysFactor;
	}

	public void setEssaysFactor(Float essaysFactor) {
		this.essaysFactor = essaysFactor;
	}

	public Float getFinalTestFactor() {
		return finalTestFactor;
	}

	public void setFinalTestFactor(Float finalTestFactor) {
		this.finalTestFactor = finalTestFactor;
	}

	@Override
	public int hashCode() {
		int hash = 0;
		hash += (id != null ? id.hashCode() : 0);
		return hash;
	}

	@Override
	public boolean equals(Object object) {
		// TODO: Warning - this method won't work in the case the id fields are
		// not set
		if (!(object instanceof CourseScoreFactor)) {
			return false;
		}
		CourseScoreFactor other = (CourseScoreFactor) object;
		if ((this.id == null && other.id != null)
				|| (this.id != null && !this.id.equals(other.id))) {
			return false;
		}
		return true;
	}

	@Override
	public String toString() {
		return "com.hieu.sms.model.CourseScoreFactor[ id=" + id + " ]";
	}

}
